package com.kd.enums.product;

/**
 * 底部层枚举
 */
public enum BottomLayerEnum {
    NONE(0, "无"),
    BOTTOM_WEIGHING(1, "底部拉秤(仅二面叉)");

    private final Integer code;
    private final String desc;

    BottomLayerEnum(Integer code, String desc) {
        this.code  = code;
        this.desc  = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static BottomLayerEnum getByCode(Integer code) {
        for (BottomLayerEnum value : values()) {
            if (value.getCode().equals(code))  {
                return value;
            }
        }
        throw new IllegalArgumentException("无效的底部层代码: " + code);
    }
}